package homework.mid_autumn_festival.collection_exercixe;

import java.util.Arrays;
import java.util.List;

public class ArrayToList {
    public static void main(String[] args) {
        String[] array = {"one","two","three","four","five"};
        System.out.println(Arrays.toString(array));

        List<String> list = Arrays.asList(array);
        System.out.println("list:"+list);

        //修改数组中元素,集合也会相应变化
        array[0] = "six";
        System.out.println("array:"+Arrays.toString(array));
        System.out.println("list:"+list);

        list.set(1,"seven");
        System.out.println("array:"+Arrays.toString(array));
        System.out.println("list:"+list);





    }
}
